<template>
  <div class="article-detail">
    <p @click="$router.go(-1)">返回</p>
    <div>
      <h1>{{articleDetail.title}}</h1>
      <p>{{articleDetail.original}}</p>
      <p>{{articleDetail.type_id}}</p>
      <p>{{articleDetail.create_time}}</p>
      <div v-html="articleDetail.content"></div>
    </div>
  </div>
</template>

<script>
  export default {
    name: "Detail",
    data() {
      return {
        articleDetail: []
      }
    },
    mounted() {
      this.getDetail();
      // this.addSign();
    },
    methods: {
      getDetail() {
        let id = this.$route.params.id
        this.getAxios('/article/getid?id=' + id).then(res => {
          console.log(res.list);
          this.articleDetail = res.list[0]
        }).catch(err => {
          console.log(err);
        })
      },
      /*//  增加观看数
      addSign() {
        let id = this.$route.params.id
        let params = {
          id,
          sign:this.articleDetail.sign
        }
        this.putAxios('/article/updatesign',{params}).then(res => {
          console.log(res);
        }).catch(err => {
          console.log(err);
        })
      }*/
    }
  }
</script>

<style scoped>

</style>